package com.woniuxy.yoga.course.client;

import com.woniuxy.yoga.commons.core.model.Result;
import com.woniuxy.yoga.course.client.dto.product.AllTeamProductDTO;
import com.woniuxy.yoga.course.client.dto.product.PrivateProductByIdDTO;
import com.woniuxy.yoga.course.client.dto.product.ProductTypeByIdDTO;
import com.woniuxy.yoga.product.model.dto.TeamProductByIdDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 产品的服务访问类
 */
@FeignClient(name = "product-service",path = "/product")
public interface ProductClient {

    /**
     * 教练ID查询团队产品
     * @param ids
     * @return
     */
    @PostMapping("/teamProduct/getByCoachId")
    public Result<List<AllTeamProductDTO>> getProductByCoachId(@RequestBody List<Integer> ids);

    /**
     * 团队产品ID查询团队产品
     * @param teamProductId
     * @return
     */
    @GetMapping("/teamProduct/getById/{teamProductId}")
    public Result<TeamProductByIdDTO> getTeamProductById(@PathVariable("teamProductId") Integer teamProductId);

    /**
     * 团队产品总天数减一
     * @param teamProductId
     * @return
     */
    @GetMapping("/teamProduct/hourCountMinusOne/{teamProductId}")
    public Result<Integer> teamProductHourCountMinusOne(@PathVariable("teamProductId") Integer teamProductId);

    /**
     * 团队产品完成
     * @param teamProductId
     * @return
     */
    @GetMapping("/teamProduct/completeTeamProduct/{teamProductId}")
    public Result<?> teamProductCompleteTeamProduct(@PathVariable("teamProductId") Integer teamProductId);

    /**
     * 根据产品类型ID查询产品类型
     * @param productTypeId
     * @return
     */
    @GetMapping("/productType/getById/{productTypeId}")
    public Result<ProductTypeByIdDTO> getProductTypeById(@PathVariable("productTypeId") Integer productTypeId);

    /**
     * 根据私教产品ID查询私教产品
     * @param privateProductId
     * @return
     */
    @GetMapping("/privateProduct/getById/{privateProductId}")
    public Result<PrivateProductByIdDTO> getPrivateProductById(@PathVariable("privateProductId") Integer privateProductId);
}
